package com.chuangke.file.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chuangke.file.model.FileInfo;

/**
 * @Description
 * @author stm
 * @date 2019年2月24日 下午10:04:17
 */
public interface FileInfoMapper extends BaseMapper<FileInfo>{

	@Select("select dbank_id, sum(size) total_size from file_info group by dbank_id")
	List<Map<String, Object>> selectTotalSize();
	
	@Update("update file_info set download_count=download_count+1 where id=#{id}")
	void updateDownloadCount(@Param("id") String id) ;
}
